<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="PHPDoctor 2RC4 (http://peej.github.com/phpdoctor/)">
<meta name="when" content="Mon, 02 May 2011 02:46:55 +0000">

<link rel="stylesheet" type="text/css" href="../stylesheet.css">
<link rel="start" href="../overview-summary.html">

<title>data (Cornice)</title>

</head>
<body id="definition" onload="parent.document.title=document.title;">

<div class="header">
<h1>Cornice</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="../cornice/package-summary.html">Package</a></li>
<li class="active">Class</li>
<li><a href="../cornice/package-tree.html">Tree</a></li>
<li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../cornice\data.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>

<div class="qualifiedName">cornice\data</div>
<a href="../source/data.php.html#line14" class="location">data.php at line 14</a>

<h1>Class data</h1>

<pre class="tree"><strong>data</strong><br /></pre>

<hr>

<p class="signature">public  class <strong>data</strong></p>

<div class="comment" id="overview_description"><p>Class for accessing serialized objects on disk</p></div>

<dl>
<dt>Author:</dt>
<dd>Nicola Dinh</dd>
<dt>Version:</dt>
<dd>2011.04.2311</dd>
</dl>
<hr>

<table id="summary_method">
<tr><th colspan="2">Method Summary</th></tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#__construct()">__construct</a>()</p><p class="description">Default instance level constructor
Just decorative, should not be called due to having only static methods</p></td>
</tr>
<tr>
<td class="type">static  boolean</td>
<td class="description"><p class="name"><a href="#cur_module_accepts()">cur_module_accepts</a>(string user_name, string password)</p><p class="description">Check if a pair of 'user name' and 'password' is accessible to 
current module</p></td>
</tr>
<tr>
<td class="type">static  boolean</td>
<td class="description"><p class="name"><a href="#file_exists()">file_exists</a>(string name, str path)</p><p class="description">Check if data file exists (data file is just serialized object)</p></td>
</tr>
<tr>
<td class="type">static  array</td>
<td class="description"><p class="name"><a href="#get_passwords()">get_passwords</a>()</p><p class="description">Get passwords stored in SPSO file (in 'data/secured')</p></td>
</tr>
<tr>
<td class="type">static  object</td>
<td class="description"><p class="name"><a href="#load_from_file()">load_from_file</a>(string name, str path)</p><p class="description">Load serialized object from file, ".pso" means 'PHP Serialized Object'</p></td>
</tr>
<tr>
<td class="type">static  void</td>
<td class="description"><p class="name"><a href="#load_from_spso()">load_from_spso</a>(string name)</p><p class="description">Load object from .spso file</p></td>
</tr>
<tr>
<td class="type">static  void</td>
<td class="description"><p class="name"><a href="#save_to_file()">save_to_file</a>(string name, object object, str path)</p><p class="description">Save object to file, ".pso" means 'PHP Serialized Object'</p></td>
</tr>
<tr>
<td class="type">static  void</td>
<td class="description"><p class="name"><a href="#save_to_spso()">save_to_spso</a>(string name, object object)</p><p class="description">Save object to .spso file</p></td>
</tr>
<tr>
<td class="type">static  boolean</td>
<td class="description"><p class="name"><a href="#spso_exists()">spso_exists</a>(string name)</p><p class="description">Check if a secured PSO exists in 'data/secured'</p></td>
</tr>
</table>

<h2 id="detail_method">Method Detail</h2>
<a href="../source/data.php.html#line25" class="location">data.php at line 25</a>

<h3 id="__construct()">__construct</h3>
<code class="signature">public  void <strong>__construct</strong>()</code>
<div class="details">
<p>Default instance level constructor
Just decorative, should not be called due to having only static methods</p></div>

<hr>

<a href="../source/data.php.html#line105" class="location">data.php at line 105</a>

<h3 id="cur_module_accepts()">cur_module_accepts</h3>
<code class="signature">public static  boolean <strong>cur_module_accepts</strong>(string user_name, string password)</code>
<div class="details">
<p>Check if a pair of 'user name' and 'password' is accessible to 
current module</p><dl>
<dt>Parameters:</dt>
<dd>user_name - The user name</dd>
<dd>password - The password for that user name</dd>
<dt>Returns:</dt>
<dd>'true' if username/password accessible to current module</dd>
</dl>
</div>

<hr>

<a href="../source/data.php.html#line52" class="location">data.php at line 52</a>

<h3 id="file_exists()">file_exists</h3>
<code class="signature">public static  boolean <strong>file_exists</strong>(string name, str path)</code>
<div class="details">
<p>Check if data file exists (data file is just serialized object)</p><dl>
<dt>Parameters:</dt>
<dd>name - The data file name</dd>
<dt>Returns:</dt>
<dd>'true' if exists, 'false' otherwise</dd>
</dl>
</div>

<hr>

<a href="../source/data.php.html#line92" class="location">data.php at line 92</a>

<h3 id="get_passwords()">get_passwords</h3>
<code class="signature">public static  array <strong>get_passwords</strong>()</code>
<div class="details">
<p>Get passwords stored in SPSO file (in 'data/secured')</p><dl>
<dt>Returns:</dt>
<dd>The list of passwords</dd>
</dl>
</div>

<hr>

<a href="../source/data.php.html#line43" class="location">data.php at line 43</a>

<h3 id="load_from_file()">load_from_file</h3>
<code class="signature">public static  object <strong>load_from_file</strong>(string name, str path)</code>
<div class="details">
<p>Load serialized object from file, ".pso" means 'PHP Serialized Object'</p><dl>
<dt>Parameters:</dt>
<dd>name - The file name of object</dd>
<dt>Returns:</dt>
<dd>The object deserialized from saved data</dd>
</dl>
</div>

<hr>

<a href="../source/data.php.html#line83" class="location">data.php at line 83</a>

<h3 id="load_from_spso()">load_from_spso</h3>
<code class="signature">public static  void <strong>load_from_spso</strong>(string name)</code>
<div class="details">
<p>Load object from .spso file</p><dl>
<dt>Parameters:</dt>
<dd>name - The name of object</dd>
</dl>
</div>

<hr>

<a href="../source/data.php.html#line34" class="location">data.php at line 34</a>

<h3 id="save_to_file()">save_to_file</h3>
<code class="signature">public static  void <strong>save_to_file</strong>(string name, object object, str path)</code>
<div class="details">
<p>Save object to file, ".pso" means 'PHP Serialized Object'</p><dl>
<dt>Parameters:</dt>
<dd>name - The file name of object</dd>
<dd>object - The object to be serialized and saved</dd>
</dl>
</div>

<hr>

<a href="../source/data.php.html#line70" class="location">data.php at line 70</a>

<h3 id="save_to_spso()">save_to_spso</h3>
<code class="signature">public static  void <strong>save_to_spso</strong>(string name, object object)</code>
<div class="details">
<p>Save object to .spso file</p><dl>
<dt>Parameters:</dt>
<dd>name - The file name to write on</dd>
<dd>object - The object to write to file</dd>
</dl>
</div>

<hr>

<a href="../source/data.php.html#line61" class="location">data.php at line 61</a>

<h3 id="spso_exists()">spso_exists</h3>
<code class="signature">public static  boolean <strong>spso_exists</strong>(string name)</code>
<div class="details">
<p>Check if a secured PSO exists in 'data/secured'</p><dl>
<dt>Parameters:</dt>
<dd>name - The name of secured PHP serialized object</dd>
<dt>Returns:</dt>
<dd>'true' if .spso file exists, 'false' otherwise</dd>
</dl>
</div>

<hr>

<div class="header">
<h1>Cornice</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="../cornice/package-summary.html">Package</a></li>
<li class="active">Class</li>
<li><a href="../cornice/package-tree.html">Tree</a></li>
<li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../cornice\data.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>

<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>

</body>

</html>